package com.netease.pris.protocol;

import com.netease.f.b;
import com.netease.f.h;
import com.netease.f.i;
import com.netease.pris.atom.ac;
import com.netease.pris.atom.ad;
import com.netease.pris.atom.q;
import com.netease.pris.atom.s;
import com.netease.pris.atom.userinfo.UserInfo;
import java.io.ByteArrayOutputStream;
import java.util.Calendar;
import java.util.Iterator;
import java.util.LinkedList;

public class n
{
  static String a = "ATOMXMLCreator";

  private static b a(ac paramac, String paramString1, String paramString2, String paramString3, String paramString4, String paramString5)
  {
    b localb1 = new b("feed");
    localb1.b("xmlns", "http://www.w3.org/2005/Atom");
    localb1.b("xmlns:pris", "http://www.163.com/pris/1.0");
    if (paramac != null)
      localb1.d(paramac);
    if (paramString1 != null)
      localb1.a("id", paramString1);
    localb1.a("title", paramString2);
    if (paramString5 != null)
      localb1.f("pris:devinfo").b("id", paramString5);
    b localb2 = localb1.f("author");
    if (paramString3 != null)
      localb2.a("name", paramString3);
    if (paramString4 != null)
    {
      b localb3 = localb1.f("link");
      localb3.b("rel", "self");
      localb3.b("type", "application/atom+xml");
      localb3.b("href", paramString4);
    }
    return localb1;
  }

  private static b a(d paramd, ac paramac, String paramString1, String paramString2, String paramString3)
  {
    if (paramd.g == null);
    for (b localb1 = a(paramac, null, paramString1, null, paramString3, a()); ; localb1 = a(paramac, paramd.g.w(), paramString1, paramd.g.G(), paramString3, a()))
    {
      Iterator localIterator = paramd.h.iterator();
      while (localIterator.hasNext())
      {
        com.netease.pris.atom.u localu = (com.netease.pris.atom.u)localIterator.next();
        if (localu.V().equals("-1"))
          continue;
        b localb2 = e(localu.V(), localu.U(), paramString2);
        if (localu.S())
        {
          b localb3 = localb2.f("pris:customization");
          localb3.b("type", localu.bd());
          if (localu.bf() != null)
            localb3.b("id", localu.bf());
        }
        localb1.d(localb2);
      }
    }
    return localb1;
  }

  private static b a(String paramString1, ac paramac, String paramString2, String paramString3)
  {
    b localb = d(paramString1, paramString2, paramString3);
    localb.d(paramac);
    return localb;
  }

  private static String a()
  {
    return com.netease.pris.a.u.g(com.netease.b.a.d.h().a());
  }

  static byte[] a(ac paramac)
  {
    ByteArrayOutputStream localByteArrayOutputStream = new ByteArrayOutputStream();
    h localh = new h(localByteArrayOutputStream);
    ad localad = new ad();
    localad.d(paramac);
    localh.b(localad);
    localh.a();
    return localByteArrayOutputStream.toByteArray();
  }

  static byte[] a(com.netease.pris.atom.u paramu, String paramString)
  {
    ByteArrayOutputStream localByteArrayOutputStream = new ByteArrayOutputStream();
    h localh = new h(localByteArrayOutputStream);
    b localb = a(null, null, "添加收藏", null, "/favorite/add.atom", a());
    localh.b(localb);
    localb.d(e(paramu.V(), paramu.U(), paramString));
    localh.a();
    return localByteArrayOutputStream.toByteArray();
  }

  public static byte[] a(UserInfo paramUserInfo)
  {
    ByteArrayOutputStream localByteArrayOutputStream = new ByteArrayOutputStream();
    h localh = new h(localByteArrayOutputStream);
    b localb = paramUserInfo.l();
    localb.b("type", "update");
    localh.b(localb);
    localh.a();
    return localByteArrayOutputStream.toByteArray();
  }

  static byte[] a(d paramd, ac paramac, String paramString)
  {
    ByteArrayOutputStream localByteArrayOutputStream = new ByteArrayOutputStream();
    h localh = new h(localByteArrayOutputStream);
    localh.b(a(paramd, paramac, "我的订阅", paramString, "/mysubscription.php"));
    localh.a();
    return localByteArrayOutputStream.toByteArray();
  }

  static byte[] a(d paramd, String paramString)
  {
    ByteArrayOutputStream localByteArrayOutputStream = new ByteArrayOutputStream();
    h localh = new h(localByteArrayOutputStream);
    localh.b(a(paramd, null, "添加收藏", paramString, "/favorite/add.atom"));
    localh.a();
    return localByteArrayOutputStream.toByteArray();
  }

  static byte[] a(d paramd, String paramString1, String paramString2)
  {
    ByteArrayOutputStream localByteArrayOutputStream = new ByteArrayOutputStream();
    h localh = new h(localByteArrayOutputStream);
    b localb = new b("sub_sources");
    localh.b(localb);
    Iterator localIterator = paramd.h.iterator();
    while (localIterator.hasNext())
    {
      com.netease.pris.atom.u localu = (com.netease.pris.atom.u)localIterator.next();
      if (localu.V().equals("-1"))
        continue;
      localb.a("id", localu.V());
    }
    localh.a();
    return localByteArrayOutputStream.toByteArray();
  }

  static byte[] a(String paramString1, String paramString2)
  {
    ByteArrayOutputStream localByteArrayOutputStream = new ByteArrayOutputStream();
    h localh = new h(localByteArrayOutputStream);
    b localb = a(null, null, "删除我的收藏", null, "/favorite/del.atom", null);
    localh.b(localb);
    localb.d(e(paramString1, null, paramString2));
    localh.a();
    return localByteArrayOutputStream.toByteArray();
  }

  static byte[] a(String paramString1, String paramString2, String paramString3)
  {
    ByteArrayOutputStream localByteArrayOutputStream = new ByteArrayOutputStream();
    h localh = new h(localByteArrayOutputStream);
    b localb = d(paramString1, "Atom-Powered Robots Run Amok", paramString2);
    localh.b(localb);
    localb.a("content", paramString3);
    localh.a();
    return localByteArrayOutputStream.toByteArray();
  }

  static byte[] a(String paramString1, String paramString2, String paramString3, float paramFloat)
  {
    ByteArrayOutputStream localByteArrayOutputStream = new ByteArrayOutputStream();
    h localh = new h(localByteArrayOutputStream);
    b localb = d(paramString1, "Atom-Powered Robots Run Amok", paramString2);
    localh.b(localb);
    localb.a("content", paramString3);
    localb.f("pris:ranking").b("value", Float.toString(paramFloat));
    localh.a();
    return localByteArrayOutputStream.toByteArray();
  }

  static byte[] a(String paramString1, String paramString2, String paramString3, ac paramac)
  {
    ByteArrayOutputStream localByteArrayOutputStream = new ByteArrayOutputStream();
    h localh = new h(localByteArrayOutputStream);
    b localb1 = a(paramac, null, null, null, null, a());
    localh.b(localb1);
    b localb2 = new b("entry");
    if (paramString1 != null)
      localb2.d(new b("id", paramString1));
    if (paramString2 != null)
    {
      b localb3 = new b("content", paramString2);
      localb3.b("type", "text");
      localb2.d(localb3);
    }
    if (paramString3 != null)
      localb2.d(new b("is_comment", paramString3));
    localb1.d(localb2);
    localh.a();
    return localByteArrayOutputStream.toByteArray();
  }

  static byte[] a(String paramString1, String paramString2, String paramString3, s params)
  {
    ByteArrayOutputStream localByteArrayOutputStream = new ByteArrayOutputStream();
    h localh = new h(localByteArrayOutputStream);
    b localb = d(paramString1, "Atom-Powered Robots Run Amok", paramString2);
    localh.b(localb);
    localb.a("content", paramString3);
    if (params == s.a)
      localb.f("pris:bump").b("action", "up");
    while (true)
    {
      localh.a();
      return localByteArrayOutputStream.toByteArray();
      localb.f("pris:bump").b("action", "down");
    }
  }

  static byte[] a(String paramString1, String paramString2, String paramString3, String paramString4)
  {
    ByteArrayOutputStream localByteArrayOutputStream = new ByteArrayOutputStream();
    h localh = new h(localByteArrayOutputStream);
    b localb = d(paramString1, "Atom-Powered Robots Run Amok", paramString2);
    localh.b(localb);
    localb.a("content", paramString3);
    localb.f("pris:sharing").b("action", paramString4);
    localh.a();
    return localByteArrayOutputStream.toByteArray();
  }

  static byte[] a(String paramString1, String paramString2, String paramString3, String paramString4, ac paramac)
  {
    ByteArrayOutputStream localByteArrayOutputStream = new ByteArrayOutputStream();
    h localh = new h(localByteArrayOutputStream);
    b localb = a(paramString1, paramac, "Atom-Powered Robots Run Amok", paramString2);
    if (paramString4 != null)
      localb.a("cid", paramString4);
    localh.b(localb);
    localb.a("content", paramString3);
    localh.a();
    return localByteArrayOutputStream.toByteArray();
  }

  public static byte[] a(String paramString1, String paramString2, String paramString3, String paramString4, ac paramac, String paramString5)
  {
    ByteArrayOutputStream localByteArrayOutputStream = new ByteArrayOutputStream();
    h localh = new h(localByteArrayOutputStream);
    b localb1 = a(paramac, null, "我的订阅", paramString5, "/customNode/subscribe.atom", a());
    localh.b(localb1);
    b localb2 = e(paramString1, paramString2, paramString5);
    if (paramString3 != null)
    {
      b localb3 = localb2.f("pris:customization");
      localb3.b("type", paramString3);
      if (paramString4 != null)
        localb3.b("id", paramString4);
    }
    localb1.d(localb2);
    localh.a();
    return localByteArrayOutputStream.toByteArray();
  }

  static byte[] a(LinkedList paramLinkedList, String paramString1, String paramString2, String paramString3)
  {
    ByteArrayOutputStream localByteArrayOutputStream = new ByteArrayOutputStream();
    h localh = new h(localByteArrayOutputStream);
    b localb1 = a(null, null, "举报非法源", paramString3, "/article/ilg.atom", a());
    localh.b(localb1);
    Iterator localIterator = paramLinkedList.iterator();
    while (localIterator.hasNext())
    {
      com.netease.pris.atom.u localu = (com.netease.pris.atom.u)localIterator.next();
      if (localu.V().equals("-1"))
        continue;
      b localb2 = e(localu.V(), paramString1, paramString3);
      localb1.d(localb2);
      if ((localu.J()) && (localu.e().a() != null))
        localb2.a("updated", localu.Y());
      localb2.a("content", paramString2).b("type", "text");
    }
    localh.a();
    return localByteArrayOutputStream.toByteArray();
  }

  static byte[] b(ac paramac)
  {
    ByteArrayOutputStream localByteArrayOutputStream = new ByteArrayOutputStream();
    h localh = new h(localByteArrayOutputStream);
    localh.b(a(null, paramac, null, null));
    localh.a();
    return localByteArrayOutputStream.toByteArray();
  }

  static byte[] b(d paramd, ac paramac, String paramString)
  {
    ByteArrayOutputStream localByteArrayOutputStream = new ByteArrayOutputStream();
    h localh = new h(localByteArrayOutputStream);
    localh.b(a(paramd, paramac, "删除我的订阅", paramString, "/sub/del.atom"));
    localh.a();
    return localByteArrayOutputStream.toByteArray();
  }

  static byte[] b(d paramd, String paramString)
  {
    ByteArrayOutputStream localByteArrayOutputStream = new ByteArrayOutputStream();
    h localh = new h(localByteArrayOutputStream);
    localh.b(a(paramd, null, "删除我的收藏", paramString, "/favorite/del.atom"));
    localh.a();
    return localByteArrayOutputStream.toByteArray();
  }

  static byte[] b(String paramString1, String paramString2)
  {
    ByteArrayOutputStream localByteArrayOutputStream = new ByteArrayOutputStream();
    h localh = new h(localByteArrayOutputStream);
    b localb = localh.c("userinfo", null);
    localb.b("type", "modifypassword");
    localb.a("old", paramString1);
    localb.a("new", paramString2);
    localh.a();
    return localByteArrayOutputStream.toByteArray();
  }

  static byte[] b(String paramString1, String paramString2, String paramString3)
  {
    ByteArrayOutputStream localByteArrayOutputStream = new ByteArrayOutputStream();
    h localh = new h(localByteArrayOutputStream);
    b localb = d(paramString1, "Atom-Powered Robots Run Amok", paramString2);
    localh.b(localb);
    localb.a("content", paramString3);
    localh.a();
    return localByteArrayOutputStream.toByteArray();
  }

  static byte[] c(d paramd, ac paramac, String paramString)
  {
    ByteArrayOutputStream localByteArrayOutputStream = new ByteArrayOutputStream();
    h localh = new h(localByteArrayOutputStream);
    localh.b(a(paramd, paramac, "我的订阅", null, "/sub/list.atom"));
    localh.a();
    return localByteArrayOutputStream.toByteArray();
  }

  static byte[] c(String paramString1, String paramString2, String paramString3)
  {
    ByteArrayOutputStream localByteArrayOutputStream = new ByteArrayOutputStream();
    h localh = new h(localByteArrayOutputStream);
    b localb1 = a(null, null, "举报非法源", paramString3, "/article/ilg.atom", a());
    localh.b(localb1);
    b localb2 = e(paramString1, "举报原因", paramString3);
    localb1.d(localb2);
    localb2.a("content", paramString2).b("type", "text");
    localh.a();
    return localByteArrayOutputStream.toByteArray();
  }

  private static b d(String paramString1, String paramString2, String paramString3)
  {
    b localb = e(paramString1, paramString2, paramString3);
    localb.b("xmlns", "http://www.w3.org/2005/Atom");
    localb.b("xmlns:pris", "http://www.163.com/pris/1.0");
    localb.a("updated", q.a(Calendar.getInstance().getTime()));
    return localb;
  }

  private static b e(String paramString1, String paramString2, String paramString3)
  {
    b localb = new b("entry");
    localb.a("id", paramString1);
    if (paramString2 != null)
      localb.a("title", paramString2);
    if (paramString3 != null)
      localb.f("author").a("name", paramString3);
    localb.f("pris:devinfo").b("id", a());
    return localb;
  }
}

/* Location:           D:\android\hack\dex2jar-0.0.9.8\classes_dex2jar.jar
 * Qualified Name:     com.netease.pris.protocol.n
 * JD-Core Version:    0.6.0
 */